﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

namespace WorkflowConsoleApplication1
{

    public class Add : NativeActivity<bool>
    {
        public InArgument<int> Target { get; set; }
        public InArgument<int> Parameters { get; set; }

        protected override void Execute(NativeActivityContext context)
        {
            this.Result.Set(context, Validate(context));
        }

        protected virtual bool Validate(NativeActivityContext context)
        {
            return (int)context.Properties.Find(NativeActivitiesContainer.TargetPropertyName) % 2 != 0;
        }

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            base.CacheMetadata(metadata);
        }
    }

    
}
